/* CSS Reset - 完整的样式重置 */

/* 1. 基础重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2. HTML5 显示元素重置 */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

/* 3. 列表样式重置 */
ul,
ol {
  list-style: none;
}

/* 4. 表格重置 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 5. 表单元素重置 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* 6. 链接重置 */
a {
  color: inherit;
  text-decoration: none;
}

/* 7. 图片和媒体元素重置 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 8. 文本元素重置 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. 代码元素重置 */
code,
kbd,
samp,
pre {
  font-family: monospace;
  font-size: 1em;
}

/* 10. 引用元素重置 */
blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}

/* 11. 定义列表重置 */
dl,
dt,
dd {
  margin: 0;
  padding: 0;
}

/* 12. 地址和引用重置 */
address,
cite,
dfn,
em,
var {
  font-style: normal;
}

/* 13. 删除线重置 */
del,
ins {
  text-decoration: none;
}

/* 14. 标记元素重置 */
mark {
  background-color: transparent;
  color: inherit;
}

/* 15. 小字体重置 */
small {
  font-size: 80%;
}

/* 16. 下标和上标重置 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* 17. 表格单元格重置 */
th,
td {
  text-align: left;
  vertical-align: top;
}

/* 18. 表单控件重置 */
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  border: 0;
  padding: 0;
  white-space: normal;
}

/* 19. 进度条和计量器重置 */
progress,
meter {
  vertical-align: baseline;
}

/* 20. 音频和视频重置 */
audio,
video {
  display: inline-block;
}

audio:not([controls]) {
  display: none;
  height: 0;
}

/* 21. 模板元素重置 */
template {
  display: none;
}

/* 22. 隐藏元素重置 */
[hidden] {
  display: none !important;
}

/* 23. 焦点样式重置 */
:focus {
  outline: 0;
}

:focus-visible {
  outline: 2px solid #007acc;
  outline-offset: 2px;
}

/* 24. 滚动条重置（Webkit） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 25. 选择文本样式重置 */
::selection {
  background-color: #007acc;
  color: white;
}

::-moz-selection {
  background-color: #007acc;
  color: white;
}

/* 26. 打印样式重置 */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* 27. 高对比度模式支持 */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor;
  }
}

/* 28. 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 29. 基础字体和行高设置 */
html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: inherit;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* 30. 清除浮动工具类 */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* 31. 屏幕阅读器专用类 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}
